package com.example.martian.mapper;

import com.example.martian.pojo.YzcmTopup;
import com.example.martian.pojo.YzcmWallet;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;

@Repository
public interface CustodyMapper {

    String selectAccountAddressById(@Param("userId") Integer userId);

    void insertWallet(YzcmWallet yzcmWallet);

    String selectAddressKeyByAddress(@Param("address") String address,@Param("coin") String coin);

    //查询用户钱包信息
    List<Map<String,Object>> selectWellatByCoinFlash(@Param("address") String address);

    //查询用户挖矿钱包信息
    List<Map<String,Object>> selectWellatByCoinFlashMining(@Param("address") String address);

    //<!--根据地址和币种更新钱包金额-->
    void updateCoinMoneyByAddressAndCoin(String coinMoney, String addressKey);

    //<!--根据地址和币种更新挖矿金额-->
    void updateCoinMoneyByAddressAndMiningCoin(String coinMoney, String addressKey);

    //根据币种查询钱包金额
    String selectCoinMoneyByCoin(String addressKey);

    //根据币种查询挖矿金额
    String selectCoinMoneyByMiningCoin(String addressKey);

    //查询所有用户addressKey
    List<Map<String,Object>> selectAddressKeyAll();

    int insertTopUpRecord(YzcmTopup yzcmTopup);

    //根据addressKey查询用户账号
    String selectAddressByAddressKey(String addressKey);

    //USDT流水记录
    List<Map<String,Object>> selectUsdtRecord(@Param("address")String address,@Param("coin")String coin);

    //询账户可用和冻结金额
    List<Map<String,Object>> selectUsdtMoneyZt(@Param("address")String address,@Param("coin")String coin);

    //查询交易唯一id
    List<Map<String,Object>> selectTransactionId(String address);

    //修改交易状态
    void updateStatus(String status,String uuid);

    //根据uuid回滚提现金额-
    void updateCoinMoney(String coinMoney,String uuid);

    //根据uuid回滚挖矿提现金额-
    void updateCoinMoneyByMining(String coinMoney,String uuid);

    //根据币种查询收益情况
    List<Map<String,Object>> checkEarningsByCoin(@Param("address")String address,@Param("type")Integer type);

    //根据币种和地址查询收益
    List<Map<String,Object>> selectHashrateByAddressAndCoin(@Param("address")String address,@Param("type")Integer type);

    //查询币种
    List<Map<String, Object>> checkCoin();

}
